package com.ytsquare.push2me.entity;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

@XmlRootElement
public class Message {
	// for message receiver
	public static final int STATUS_UNHANDLE = 0;
	public static final int STATUS_READ = 1;
	// for message sender
	public static final int STATUS_SENT = 100;
	public static final int STATUS_DELETE = 101;
	
	public static final int PRIORITY_HIGHEST = 5;
	public static final int PRIORITY_HIGHER = 4;
	public static final int PRIORITY_HIGH = 3;
	public static final int PRIORITY_NORMAL = 2;
	public static final int PRIORITY_LOW = 1;
	
	// generated by uuid
	private String messageId; 
	
	private List<User> toUser = new ArrayList<User>();
	private User fromUser;
	private String title;
	private String content;
	// format "yyyy-MM-dd HH:mm:ss"
	private String messageDate; 

	private int priorityId; // define message priority 
	private int messageHandleStatusId; // define message handle status 
	
	private List<Attachement> attachements = new ArrayList<Attachement>();
	
	@XmlTransient
	class Attachement {
		public String attachmentId;
		public String name;
		public String location;
	}
		
	public Message() {
		
	}

	public String getMessageId() {
		return messageId;
	}

	public void setMessageId(String messageId) {
		this.messageId = messageId;
	}

	public List<User> getToUser() {
		return toUser;
	}

	public void setToUser(List<User> toUser) {
		this.toUser = toUser;
	}

	public User getFromUser() {
		return fromUser;
	}

	public void setFromUser(User fromUser) {
		this.fromUser = fromUser;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getMessageDate() {
		return messageDate;
	}

	public void setMessageDate(String messageDate) {
		this.messageDate = messageDate;
	}

	public int getPriorityId() {
		return priorityId;
	}

	public void setPriorityId(int priorityId) {
		this.priorityId = priorityId;
	}

	public int getMessageHandleStatusId() {
		return messageHandleStatusId;
	}

	public void setMessageHandleStatusId(int messageHandleStatusId) {
		this.messageHandleStatusId = messageHandleStatusId;
	}

	public List<Attachement> getAttachements() {
		return attachements;
	}

	public void setAttachements(List<Attachement> attachements) {
		this.attachements = attachements;
	}
}
